<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header">
    <!-- 必要的标签 -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link crossorigin="anonymous" integrity="sha512-6KY5s6UI5J7SVYuZB4S/CZMyPylqyyNZco376NM2Z8Sb8OxEdp02e1jkKk/wZxIEmjQ6DRCEBhni+gpr9c4tvA==" href="https://lib.baomitu.com/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
<nav th:replace="layouts::navbar"></nav>
<div class="container">
    <form th:action="@{/units/save}" th:object="${unit}" method="POST">
        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="昵称" th:field="${unit.username}">
                <span th:if="${#fields.hasErrors('username')}" th:errors="${unit.username}"></span>
            </div>
        </div><br>
        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="密码" th:field="${unit.password}">
                <span th:if="${#fields.hasErrors('password')}" th:errors="${unit.password}"></span>
            </div>
        </div><br>
                <div class="form-group">
                    <div class="col-sm-6">
        <input type="text" placeholder="性别" th:field="${unit.gender}">
                        <span th:if="${#fields.hasErrors('gender')}" th:errors="${unit.gender}"></span>
                    </div>
                </div><br>

                        <div class="form-group">
                            <div class="col-sm-6">
        <input type="text" placeholder="年龄" th:field="${unit.age}">
                                <span th:if="${#fields.hasErrors('age')}" th:errors="${unit.age}"></span>

                            </div>
                        </div><br>

        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="邮箱" th:field="${unit.email}">
                                        <span th:if="${#fields.hasErrors('email')}" th:errors="${unit.email}"></span>
                                    </div>
                                </div><br>

        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="用户发布动态和评论ID" th:field="${unit.promulgatorID}">
                                                <span th:if="${#fields.hasErrors('promulgatorID')}" th:errors="${unit.promulgatorID}"></span>
                                            </div>
                                        </div><br>

        <button class="btn btn-info" type="submit">新建用户</button>
    </form>
</div>

</body>
</html>